﻿using System.Collections.Generic;

using Orchard;

namespace AMC.SubstitutionCache.Events
{
    public interface ISubstitutionEvents : IDependency
    {
        /// <summary>
        /// Fired during the initial rendering phase when a possible replacement shape has been found. If context.Cancel is true, substitution will not be added.
        /// </summary>
        /// <param name="context"></param>
        void SubstitutionAdding(SubstitutionAddingContext context);
        /// <summary>
        /// Fired during the initial rendering phase when a substitution shape has been found and added to the cache item's list.
        /// </summary>
        /// <param name="context"></param>
        void SubstitutionAdded(SubstitutionAddedContext context);

        /// <summary>
        /// Fired 1st, during the substitution processing. If context.ShapeOutput is set, will be used rather than a full re-render.
        /// </summary>
        /// <param name="context"></param>
        void Replacing(SubstitutionReplacingContext context);
        /// <summary>
        /// Fired 2nd, during the substitution processing before the shape is created.
        /// </summary>
        /// <param name="context"></param>
        void ShapeCreating(SubstitutionShapeCreatingContext context);
        /// <summary>
        /// Fired 3rd, during the substitution processing after the shape has been created.
        /// </summary>
        /// <param name="context"></param>
        void ShapeCreated(SubstitutionShapeCreatedContext context);
        /// <summary>
        /// Fired 4th, during the substitution processing before the shape is rendered.
        /// </summary>
        /// <param name="context"></param>
        void Rendering(SubstitutionRenderingContext context);
        /// <summary>
        /// Fired 5th, during the substitution processing after the shape has been rendered.
        /// </summary>
        /// <param name="context"></param>
        void Rendered(SubstitutionRenderedContext context);
        /// <summary>
        /// Fired last (6th), during the substitution processing after the shape has been rendered and output set.
        /// </summary>
        /// <param name="context"></param>
        void Replaced(SubstitutionReplacedContext context);
    }
}